package com.lanou.service;

import com.lanou.bean.Account;
import com.lanou.mapper.AccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by lanouhn on 17/10/23.
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService{

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public List<Account> selectAllAccount() {
        return accountMapper.selectAllAccount();
    }

    @Override
    public int updateStatus(Integer account_id, Integer status,Date pause_date) {
        System.out.println("service层..");
        return accountMapper.updateStatus(account_id,status,pause_date);
    }

    @Override
    public int updateStatus1(Integer account_id, Integer status,Date close_date) {
        System.out.println("service层..");
        return accountMapper.updateStatus(account_id,status,close_date);
    }

    @Override
    public int selectIdByidcard(String referrerid) {
        return accountMapper.selectIdByidcard(referrerid);
    }

    @Override
    public int insertAccount(Account account) {
        return accountMapper.insertAccount(account);
    }


    @Override
    public int updateAccount(Integer account_id, Date close_date) {
        return accountMapper.updateAccount(account_id,close_date);
    }

    @Override
    public Account selectAccountById(Integer account_id) {
        return accountMapper.selectAccountById(account_id);
    }

    @Override
    public Account selectidcardById(Integer recommenderId) {
        return accountMapper.selectidcardById(recommenderId);
    }

    @Override
    public int updateAccountInfo(Account account) {
        return accountMapper.updateAccountInfo(account);
    }

    @Override
    public List<Account> selectAllAccountByCondition(Account account) {
        return accountMapper.selectAllAccountByCondition(account);
    }
}
